﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Publishers.aspx.cs" Inherits="Publishers" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
    <p>
        <asp:DataList ID="DataList1" runat="server" DataKeyField="pub_id" 
            DataSourceID="SqlDataSource2">
            <ItemTemplate>
              <asp:Label ID="pub_nameLabel" runat="server" Text='<%# Eval("pub_name") %>' />
                <br />
<br />
            </ItemTemplate>
        </asp:DataList>
        <br />
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:mybookstoreConnectionString1 %>" 
            DeleteCommand="DELETE FROM [publishers] WHERE [pub_id] = @pub_id" 
            InsertCommand="INSERT INTO [publishers] ([pub_name]) VALUES (@pub_name)" 
            ProviderName="<%$ ConnectionStrings:mybookstoreConnectionString1.ProviderName %>" 
            SelectCommand="SELECT [pub_id], [pub_name] FROM [publishers]" 
            UpdateCommand="UPDATE [publishers] SET [pub_name] = @pub_name WHERE [pub_id] = @pub_id">
            <DeleteParameters>
                <asp:Parameter Name="pub_id" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="pub_name" Type="String" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="pub_name" Type="String" />
                <asp:Parameter Name="pub_id" Type="Int32" />
            </UpdateParameters>
        </asp:SqlDataSource>
    </p>
</asp:Content>

